using System;
using System.Data;
using digit.Core;

namespace SMS.SmManager
{
    public class ProcessLogsData
    {
        #region CONSTRUCTORS
        public ProcessLogsData(string connectionString)
        {
            this.m_connectionString = connectionString;
        }
        #endregion

        #region ATTRIBUTES
        const string SQL_INSERT = "vn1102_Insert_ProcessLogs";
        const string SQL_UPDATE = "vn1102_Update_ProcessLogs";
        const string SQL_DELETE = "vn1102_Delete_ProcessLogs";
        const string SQL_SELECTONE = "vn1102_Select_ProcessLogs";
        const string SQL_SELECTALL = "vn1102_SelectAll_ProcessLogs";
        const string SQL_SEARCH = "vn1102_Search_ProcessLogs";
        private string m_connectionString;
        #endregion

        #region METHODS
        public bool Insert(object[] values)
        {
            int i = DataAccess.ExecuteStoreProcedure(this.m_connectionString, SQL_INSERT, values);
            return i > 0;
        }

        public bool Update(object[] values)
        {
            int i = DataAccess.ExecuteStoreProcedure(this.m_connectionString, SQL_UPDATE, values);
            return i > 0;
        }

        public bool Delete(object[] values)
        {
            int i = DataAccess.ExecuteStoreProcedure(this.m_connectionString, SQL_DELETE, values);
            return i > 0;
        }

        public DataTable Select(object[] values)
        {
            return DataAccess.FillTable(this.m_connectionString, SQL_SELECTONE, values, true);
        }

        public DataTable SelectAll()
        {
            return DataAccess.FillTable(this.m_connectionString, SQL_SELECTALL, true);
        }

        #endregion

    }
}